*****JMR
*****June 19, 2024
*****Replication code for Curry/Roberts, "Interpersonal Relationships, Bipartisanship, and January 6th"
*****All analyses below were executed in Stata version 15
*****Variable labels include descriptions and codings of indicator variables and other categorical variables


*******The code below will generate the bipartisan collaboration analysis found in Figure 1 of the manuscript
****Open the data
use objectors.dta

graph box bill_rate_all, over(group) over(congress) scheme(s1mono)

****The code below will generate the bipartisan collaboration analysis found in Table 1 of the manuscript
****Open the data
use objectors.dta

**column 1
xi: reg bill_rate_all objector i.congress i.icpsr_sponsor
**column2
xi: nbreg bill_count_all objector i.congress i.icpsr_sponsor 

**column 3
xi: reg bill_rate_hr objector i.congress i.icpsr_sponsor
**column 4
xi: nbreg bill_count_hr objector i.congress i.icpsr_sponsor

****The code below will generate the identical bills analysis found in Table 2 of the manuscript.

****Open the data
use identical_bills.dta

****fit logit model from Table 2 of paper

logit still_bipartisan objector dwnom1 trumpier if party_code==200, cluster(icpsr_sponsor)




***The code below will generate the legislative effectiveness component models reported in Table 3 of the manuscript

***The legislative effectiveness data is generously provided by Craig Volden and Alan Wiseman and is available at: https://thelawmakers.org/data-download

****Open the data
use cel_objectors.dta

**model for action in committee
xi: nbreg allaic1 objector i.congress i.icpsr_sponsor

**model for action beyond committee
xi: nbreg allabc1 objector i.congress i.icpsr_sponsor

**model for bills that pass
**note this is a poisson model instead of negative binomial due to convergence issues with negative binomial.
xi: poisson allpass1 objector i.congress i.icpsr_sponsor



****Code for Supplemental Appendix


***The code below will reproduce data from Table 1.1 and Table 1.2 in the Supplemental Appendix

**open data
use objectors.dta

**Table 1.1
sort congress group
by congress group: sum bills_sponsored

***Table 1.2
tab congress group


***The code below will reproduce data from Table 2.1 in the Supplemental Appendix

**open data
use objectors.dta

***Table 2.1
**column 1
xi: reg bill_rate_all objector trump20 trumpier i.congress i.icpsr_sponsor
**column2
xi: nbreg bill_count_all objector trump20 trumpier i.congress i.icpsr_sponsor, dif

**column 3
xi: reg bill_rate_hr objector trump20 trumpier i.congress i.icpsr_sponsor
**column 4
xi: nbreg bill_count_hr objector trump20 trumpier i.congress i.icpsr_sponsor, dif

***The code below will reproduce data from Table 2.2 in the Supplemental Appendix
***The legislative effectiveness data is generously provided by Craig Volden and Alan Wiseman and is available at: https://thelawmakers.org/data-download

****Open the data
use cel_objectors.dta

**model for action in committee
xi: nbreg allaic1 objector trump20 trumpier i.congress i.icpsr_sponsor, dif

**model for action beyond committee
xi: nbreg allabc1 objector trump20 trumpier i.congress i.icpsr_sponsor, dif

**model for bills that pass
xi: nbreg allpass1 objector trump20 trumpier i.congress i.icpsr_sponsor, dif

***The code below will reproduce data from Table 2.3 in the Supplemental Appendix

**open data
use objectors.dta

***Table 2.3
**column 1
xi: reg bill_rate_all objector power chair i.congress i.icpsr_sponsor
**column2
**note poisson model used due to convergence issue with negative binomial
xi: poisson bill_count_all objector power chair i.congress i.icpsr_sponsor

**column 3
xi: reg bill_rate_hr objector power chair i.congress i.icpsr_sponsor
**column 4
xi: nbreg bill_count_hr objector power chair  i.congress i.icpsr_sponsor, dif

***The code below will reproduce data from Table 2.4 in the Supplemental Appendix
***The legislative effectiveness data is generously provided by Craig Volden and Alan Wiseman and is available at: https://thelawmakers.org/data-download

****Open the data
use cel_objectors.dta

**model for action in committee
**note poisson model used due to convergence issue with negative binomial
xi: poisson allaic1 objector power chair  i.congress i.icpsr_sponsor, dif

**model for action beyond committee
**note poisson model used due to convergence issue with negative binomial
xi: poisson allabc1 objector power chair  i.congress i.icpsr_sponsor, dif

**model for bills that pass
xi: nbreg allpass1 objector power chair  i.congress i.icpsr_sponsor, dif

***The code below will reproduce data from Table 2.5 in the Supplemental Appendix
****Open the data
use identical_bills.dta

**model 
reg bi_consp objector dwnom1 trumpier if party_code==200 & still_bipartisan~=., cluster(icpsr)

